

<%@ page import="ratemymacclass.ProfRating" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'profRating.label', default: 'ProfRating')}" />
        <title><g:message code="default.create.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav" style="text-align:center;">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="Home"/></a></span>
            <span class="menuButton"><g:link class="list" action="list"><g:message code="Professor Rating List" args="[entityName]" /></g:link></span>
            <span class="menuButton"><g:link controller="course" class="list" action="list">List of Courses</g:link></span>
        <span class="menuButton"><g:link controller="professor" class="list" action="list">List of Professors</g:link></span>
        <span class="menuButton"><g:link controller="course" class="list" action="showCourseSearch">Find a Professor/Course</g:link></span>

        </div>
        <div class="body">
            <h1><g:message code="Add a new rating" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${profRatingInstance}">
            <div class="errors">
                <g:renderErrors bean="${profRatingInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="save" >
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="professor"><g:message code="profRating.professor.label" default="Professor" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: profRatingInstance, field: 'professor', 'errors')}">
                                    <g:select name="professor.id" from="${ratemymacclass.Professor.get(params.profID)}" optionKey="id" value="${profRatingInstance?.professor?.id}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="hot"><g:message code="profRating.hot.label" default="Hot" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: profRatingInstance, field: 'hot', 'errors')}">
                                    <g:radioGroup values="[1,2,3,4,5]" name="hot" value="${hasErrors(bean: profRatingInstance, field: 'hot', 'errors')}" labels="['1','2','3','4','5']" >
                                    <div style="float:left;">
                                         ${it.radio}<p><g:message code="${it.label}"/><p> </div>
                                    </g:radioGroup>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="clarity"><g:message code="profRating.clarity.label" default="Clarity" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: profRatingInstance, field: 'clarity', 'errors')}">
                                     <g:radioGroup values="[1,2,3,4,5]" name="clarity" value="${hasErrors(bean: profRatingInstance, field: 'clarity', 'errors')}" labels="['1','2','3','4','5']" >
                                    <div style="float:left;">
                                         ${it.radio}<p><g:message code="${it.label}"/><p> </div>
                                    </g:radioGroup>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="accessible"><g:message code="profRating.accessible.label" default="Accessible" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: profRatingInstance, field: 'accessible', 'errors')}">
                                    <g:radioGroup values="[1,2,3,4,5]" name="accessible" value="${hasErrors(bean: profRatingInstance, field: 'accessible', 'errors')}" labels="['1','2','3','4','5']" >
                                    <div style="float:left;">
                                         ${it.radio}<p><g:message code="${it.label}"/><p> </div>
                                    </g:radioGroup>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="textbook"><g:message code="profRating.textbook.label" default="Textbook" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: profRatingInstance, field: 'textbook', 'errors')}">
                                    <g:radioGroup values="[1,2,3,4,5]" name="textbook" value="${hasErrors(bean: profRatingInstance, field: 'textbook', 'errors')}" labels="['1','2','3','4','5']" >
                                    <div style="float:left;">
                                         ${it.radio}<p><g:message code="${it.label}"/><p> </div>
                                    </g:radioGroup>
                                </td>
                            </tr>
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'Save Record', default: 'Save Record')}" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
